package com.cz.nongyetongv5.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.cz.nongyetongv5.R;
import com.github.chrisbanes.photoview.PhotoView;

public class SinglePicActivity extends Activity {
    private TextView title; //标题
    private int type = 0;
    private PhotoView photo_view;
    private String url = "";
    private RelativeLayout rl_back;
    private String kind;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_pic);
        title = findViewById(R.id.tv_title);
        photo_view = findViewById(R.id.photo_view);
        rl_back = findViewById(R.id.rl_back);
        type = getIntent().getIntExtra("type", 0);
        kind = getIntent().getStringExtra("kind");
        if (type == 0) {
            if (kind.equals("6")){
                title.setText("资格认定证照");
            }else {
                title.setText("营业执照");
            }
        } else if (type == 1) {
            title.setText("手持身份证正面");
        } else if (type == 2) {
            title.setText("身份证正面");
        } else if (type == 3) {
            title.setText("身份证反面");
        }
        url = getIntent().getStringExtra("url");
        Glide.with(this)
                .load(url)
                .into(photo_view);
        rl_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
